package utility

import (
	"crypto/md5"
	"fmt"
)

// PasswordEncrypt EncryptPassword 对密码进行MD5加盐加密
// 返回：加密后的字符串、错误
func PasswordEncrypt(password string) (encrypted string) {
	data := []byte(password)
	has := md5.Sum(data)
	md5str1 := fmt.Sprintf("%x", has) //将[]byte转成16进制
	return md5str1
}
